package net.promethe.rsoul
{
	import air.update.ApplicationUpdaterUI;
	import air.update.events.UpdateEvent;
	
	public class AutoUpdate
	{
		public static const UPDATE_URL	: String		= "http://rsoul.promethe.net/update.xml";
		
		private static var _updateUI	: ApplicationUpdaterUI	= new ApplicationUpdaterUI();
		
		public static function checkNow(mySilent : Boolean = false) : void
		{
            _updateUI.updateURL = UPDATE_URL;
            _updateUI.isCheckForUpdateVisible = !mySilent;
            _updateUI.addEventListener(UpdateEvent.INITIALIZED, updateInitializedHandler);
            _updateUI.initialize();
    	}
    	
    	private static function updateInitializedHandler(event : UpdateEvent) : void
    	{
    		_updateUI.checkNow();
    	}

	}
}